{include file="/public/top" /}

{include file="/public/layui" /}


<div class="pad">
  <div class="breadNav">
    <div class="flt breadNav_text"> <span>项目</span><i></i><span>项目管理</span><i></i><span>众筹管理</span> </div>
    <div class="frt breadNav_other">
      <div class="bn_input theme-pop-btn">
      
      <div class="bn_input"> </div>
    </div>
    <div class="clear"></div>
  </div>
</div>
<form target="zhuchuang_frm" method="post">
<div class="daemonTable">
  <table class="table_data daemon_data" cellpadding="0" cellspacing="0">
    <tbody><tr>
      <th class="w-100"> 序号 </th>
      <th>标题</th>
      <th>车商</th>
      <th>开始时间</th>
      <th>筹资时间</th>
      <th>持有时间</th>
      <th>投票时间</th>
      <th>筹资金额</th>
      <th>上线</th>
      <th>发布时间</th>
      
      <th class="w-200"> 操作 </th>
    </tr>
	{volist name="project" id="vo"}
    <tr class="cred">
        <td>{$vo.id}</td>
        <td>{$vo.title}</td>
         <td>{$vo.cheshang_id}</td>
        <td>{$vo.stime} </td>
        <td>{$vo.days}</td>
        <td>{$vo.chi_days}</td>
        <td>{$vo.toupiao}</td>
		<td>{$vo.money}</td>         
         
        <td>          <span class="green">{$vo.audit|projectstatus}          </span></td>
 		<td>{$vo.addtime} </td>
         <td>
          <a href="{:url('project/projectab',array('id'=>$vo['id']))}" class="pub_btn ">查看</a><a  onclick='ztp({$vo.id})' class="pub_btn ">转投票</a>         </td>
      </tr>
	  {/volist}
	   </tbody></table>
</div>
<div class="daemonBot">
  <div class="flt daemonBot_cz"> </div>
  <div class="frt daemonPage"> <div class="paging"> <span>{$project->render()}</span>            </div> </div>
  <div class="clear"></div>
</div>
</form></div>
<div class="theme-popover">   
</div>
<div class="theme-popover-mask"></div>


<script>
$(function(){


          
          
			
			
        });
		 function loginsubmit(id){
                var money=true;
              
                if($('#theForm input[name=money]').val() == ''){
                    $('#error').html('<span class="error">金额不能为空!</span>');
                    $('#theForm input[name=money]').focus();
                    money = false;
                    return false;
                }

              
                if( $('#theForm input[name=money]').val() != '' ){
                    $.ajax({
                        async:false,
                        url:"{:url('project/ajaxsale')}",
                        data:{'money':$('#theForm input[name=money]').val(),'id':id},
                        type:'post',
                        dataType:'json',
                        success:function(res){
							console.log(res); 
							 
								
								
                                
                            if(res.status != 1){
                                $('#error').html('<span class="error">'+res.msg+'!</span>');
                                
                                money=false;
                                
                                return false;
                            }else{
                                
								layer.close(layer.index);
								msg(res.msg);
								
                            }
                        },
                        error : function(XMLHttpRequest, textStatus, errorThrown) {
							console.log(textStatus);
                            $('#error').html('<span class="error">网络失败，请刷新页面后重试!</span>');
                        }
                    });
                }else{
                    return false;
                }
            }
</script>
<script>
function  ztp(id){
layui.use('layer', function(){
  var layer = layui.layer;
  
  layer.open({
	  type:'1',
	  id:'layui',
  title: '转投票'
  ,content: '<form  method="post" id="theForm"   enctype="multipart/form-data"><table class="table_data" cellpadding="0" cellspacing="0"><tbody><tr><th class="alginRt w-200"> <font class="pointcl">*</font> 实际金额： </th><td><input type="text" name="money" value="" class="text w-200"></td></tr><tr><th class="alginRt w-100" style="z-index:1000"> </th><td><input class="pub_btn" type="button" name=”submit“ onclick="loginsubmit('+id+')" value="确认编辑"></td></tr> </tbody></table></form><div id="error" style="bottom: 12px;text-align: center; line-height: 20px;color: red;"><span class="table_data"></span></div>'
});  
}); 
}
</script>
</body></html>